<?php
	$url = urldecode($_GET["url"]);
	$z = getimagesize(dirname(__FILE__).$url);
	
	if ($url != '')
	$uri = $url;

	$width  = $z[0];
	$height = ($z[1]);

	if($_GET['zoom'] > 0 and is_numeric($_GET['zoom'])){
	$zoomed = $_GET['zoom'];
	$xy = ($_GET['zoom']/100);
	}
	else{
	$zoomed = 100;
	$xy = 1;
	}

	$width  = ($z[0]*$xy);
	$height = ($z[1]*$xy);

	$zh = $height+120;
	$zw = $width+10;
	
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Compact Image preview</title>
<!--
		<link href="/img/styles.css" rel="stylesheet" type="text/css">
-->
<script type="text/javascript">                            
function  adjustWindowSize()
{
	window.resizeTo(<?php echo "$zw".","."$zh"; ?>);
}
</script>

</head>

<body style="margin: 0 0 0 0;" onload="javascript: adjustWindowSize(); ">
<table cellspacing='0' cellpadding='0' border='0'>

<tr valign='top' align='center'>
<td>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=20'; ?>"><?php if ($zoomed == 20) echo '<u>'; ?>20% <?php if ($zoomed == 20) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=40'; ?>"><?php if ($zoomed == 40) echo '<u>'; ?>40% <?php if ($zoomed == 40) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=60'; ?>"><?php if ($zoomed == 60) echo '<u>'; ?>60% <?php if ($zoomed == 60) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=80'; ?>"><?php if ($zoomed == 80) echo '<u>'; ?>80% <?php if ($zoomed == 80) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=100'; ?>"><?php if ($zoomed == 100) echo '<u>'; ?>100% <?php if ($zoomed == 100) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=120'; ?>"><?php if ($zoomed == 120) echo '<u>'; ?>120% <?php if ($zoomed == 120) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=140'; ?>"><?php if ($zoomed == 140) echo '<u>'; ?>140% <?php if ($zoomed == 140) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=160'; ?>"><?php if ($zoomed == 160) echo '<u>'; ?>160% <?php if ($zoomed == 160) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=180'; ?>"><?php if ($zoomed == 180) echo '<u>'; ?>180% <?php if ($zoomed == 180) echo '</u>'; ?>|</a>
<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" href="<?php echo 'minipreview.php?url='.$uri.'&amp;zoom=200'; ?>"><?php if ($zoomed == 200) echo '<u>'; ?>200% <?php if ($zoomed == 200) echo '</u>'; ?>|</a>
</td>
</tr>

<tr valign='top' align='center'>
<td valign="top">
	<div align="center" >
	<img src="<?php echo  $url; ?>" <?php //echo $z[3]; ?> width="<?php echo $width; ?>" height="<?php echo $height; ?>"  vspace="4" border="0" alt="" />
	</div>
</td>
</tr>
<tr>
	<td align="center">
		<a style="font-family: tahoma; font-size: 12px; color: #000000; font-weight: bold; text-decoration: none;" 
			href="#" onClick="javascript: window.close(); ">Close Window</a>
	</td>
</tr>
<tr>
	<td><br /></td>
</tr>
</table>

</body>
</html>